package com.nts.visionworks.business.application.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import com.nts.visionworks.business.contents.domain.Contents;
import com.nts.visionworks.core.validation.EntityIdNotNull;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * ApplicationMenuContents generated by hbm2java
 */
@Entity
@Table(name = "application_menu_contents", catalog = "visionworks")
public class ApplicationMenuContents implements java.io.Serializable
{

	private ApplicationMenuContentsId id;
	private ApplicationMenu applicationMenu;
	private Contents contents;

	public ApplicationMenuContents()
	{
	}

	public ApplicationMenuContents(ApplicationMenuContentsId id,
			ApplicationMenu applicationMenu, Contents contents)
	{
		this.id = id;
		this.applicationMenu = applicationMenu;
		this.contents = contents;
	}

	@EmbeddedId
	@AttributeOverrides(
	{
			@AttributeOverride(name = "menuId", column = @Column(name = "MenuId", nullable = false)),
			@AttributeOverride(name = "contentsId", column = @Column(name = "ContentsId", nullable = false)) })
	public ApplicationMenuContentsId getId()
	{
		return this.id;
	}

	public void setId(ApplicationMenuContentsId id)
	{
		this.id = id;
	}

	@EntityIdNotNull(message = "validation.applicationMenuContents.applicationMenu.notNull")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MenuId", nullable = false, insertable = false, updatable = false)
	public ApplicationMenu getApplicationMenu()
	{
		return this.applicationMenu;
	}

	public void setApplicationMenu(ApplicationMenu applicationMenu)
	{
		this.applicationMenu = applicationMenu;
	}

	@EntityIdNotNull(message = "validation.applicationMenuContents.contents.notNull")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ContentsId", nullable = false, insertable = false, updatable = false)
	public Contents getContents()
	{
		return this.contents;
	}

	public void setContents(Contents contents)
	{
		this.contents = contents;
	}

}
